﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default3 : System.Web.UI.Page
{
    List<item> shoppingCart;
    public void Page_Load(object sender, EventArgs e)
    {
        lsvOffers.ItemCommand += new EventHandler<ListViewCommandEventArgs>(lsvOffers_ItemCommand);
        lsvOffers.SelectedIndexChanging += new EventHandler<ListViewSelectEventArgs>(lsvOffers_SelectedIndexChanging);
        
    }

    void lsvOffers_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
    {
        //int index = lsvOffers.SelectedIndex;
        //Response.Write(lsvOffers.Items[1].DataItem.ToString()+"\n");
        //Response.Write(lsvOffers.Items[1].Controls[1].ToString() + "\n");
        
    }

    public void lsvOffers_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (Session["shoppingCart"] == null)
        {
            shoppingCart = new List<item>();
        }

        if (String.Equals(e.CommandName, "Select"))
        {
            lsvOffers.DataKeyNames = new string[] { "item_id" };
            Response.Write(lsvOffers.Items[0].ItemType.ToString());
           
            
        }
    }
    
    void btnAddToCart_click() { }
   
   
}